﻿<UserControl x:Class="CatalogModule.Views.AddLopView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:prism="http://www.codeplex.com/prism"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             mc:Ignorable="d" 
             MinHeight="300" MinWidth="300" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Infrastructure;component/Themes/CommonTemplates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Border BorderBrush="#FFBABABA" BorderThickness="1" CornerRadius="4">
        <Border.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="White" Offset="0.05"/>
                <GradientStop Color="#FFF7F7F7"/>
                <GradientStop Color="White" Offset="1"/>
            </LinearGradientBrush>
        </Border.Background>
        <Grid Margin="20 10 20 20">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <StackPanel>
                <TextBlock Margin="40,10,0,0" Text="Tạo mới lớp" FontWeight="Bold" Foreground="#FF7A7A7A" HorizontalAlignment="Left"  FontFamily="Segoe UI" FontSize="16" />
                <Rectangle Fill="#FFD6D6D6" Height="1" Margin="0,10 0,15" />
            </StackPanel>
            <Grid  Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="135" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <TextBlock Text="Mã lớp:" Grid.Row="0" Style="{StaticResource TextBlockStyle}" />
                <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding MaLop,Mode=TwoWay}" />

                <TextBlock Text="Tên lớp:" Grid.Row="1" Style="{StaticResource TextBlockStyle}" />
                <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding TenGoi,Mode=TwoWay}" />

                <TextBlock Text="Mô tả:" Grid.Row="2" Style="{StaticResource TextBlockStyle}" />
                <TextBox Grid.Column="1" Grid.Row="2" Text="{Binding MoTa,Mode=TwoWay}" />

                <TextBlock Text="Đơn vị:" Grid.Row="3" Style="{StaticResource TextBlockStyle}" />
                <telerik:RadComboBox Grid.Column="1" Grid.Row="3" Name="radComboBox1" Margin="0,0,0,15"
                                     SelectedItem="{Binding CurrentDonVi, Mode=TwoWay}" ItemsSource="{Binding DonViList}"
                                     DisplayMemberPath="TenGoi" />
                
                <TextBlock Text="Khóa học:" Grid.Row="4" Style="{StaticResource TextBlockStyle}" />
                <telerik:RadComboBox Grid.Column="1" Grid.Row="4" Name="radComboBox2" Margin="0,0,0,15"
                                     SelectedItem="{Binding CurrentKhoaHoc, Mode=TwoWay}" ItemsSource="{Binding KhoaHocList}"
                                     DisplayMemberPath="TenGoi"/>

                <StackPanel Grid.Column="1" Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right">
                    <telerik:RadButton Content="Lưu lại" HorizontalAlignment="Right" Name="radButton1" Width="75" Command="{Binding AddNewCommand}" />
                    <telerik:RadButton Content="Hủy bỏ" HorizontalAlignment="Right" Name="radButton2" Width="75" Command="{Binding CancelCommand}"/>
                </StackPanel>
            </Grid>
        </Grid>
    </Border>
</UserControl>
